added layout var manipulation and event control