added key functions and esc closes