added features to protect against user input