Fixed db query
Merge branch 'master' of https://github.com/circleio/circle