Fixed typo

I think you forgot the if statement, currently it always throws an exception :)