added indexes to speed up db queries