Added listeners for input fields and buttons