added if checks for controller events