changed IllegalArgumentException to IllegalStateException - the
IllegalArgumentException is not catched and will cause a wrong error
message on the server