Fix for callback being called incorrectly