added wrapping query result with objects function