fixed some input checks