added functionality to get information from database.