Working! :)
Added shutdown handling