Move command handler after updating activity