Added test for key handler