did some changes for database storing.