added keyboard handler