trying callback function for fixing bugs (not working)