added rail road like error handling