added input validation to clipboard