added checking for db returns
Merge branch 'develop' of https://github.com/jiangkuo888/ORP_beta into develop