Added proper shutdown
Merge branch 'develop'