added return for get_db() and added hashing of groups