added exception handling in case showing the trajectory fails