Add more input verification