adding input check