fixed some database naming error and the new app works on postgresql