adding callback undefined problem