All functions are now working properly