attempt to fix trail code