Functions WS 21 - added user input check