modify js to log with enter