Trap Terminate Bug Fix