Removed LDAP part, add database check