Fixing invocation of callback