fix route for object page by checking for attachment var