fixed js bug calling callback too offten