fixes bcrypt bug
fix validation for rails 4