Fix control function