trouble with trail implementation