fixing errors with callbacks