Added the method for callback in ajax fails or success