script for controls