added support for cancelling trajectory