removed outdated oninput code, fixed order of events