created method for getting usernames from database