fixing a little bug with callbacks