add on enter handler. need test.
changed statement by method