fixing some callback bugs