change stages, add disconnects and exception handling