Made some input checks