fixing issue with active_record patch