Function has incorrect column name (register_by_id which s/b registered_by_id) - so always returns true.