Moved controls calls to onclick