Add throwing an error on incorrect input