Fix handler being called multiple times