Fix callback calling more than once