updated db queries