src: added input handling