fixed error causing rails to crash