changed conditional to meet devise docs