fixed database crashes
Merge branch 'master' of https://github.com/sprakash0/CODE2014