some basic input checking