Changed Code According to Database.