changed db queries