Added a bit more error cathing to tail node