added functions for adding listeners, events and controls