added onenter function