fixing bug with callbacks, now it should work