Fixing path and query bug