added shutdown hook for controllers, and fixed strict errors