added method for database