using fail instead of raise is O.o