added input sanitizing