added basic input check