Add check to see if objects exists in ajax functions.