Removed connection from query method