Trying to get on ready function to work