Added cleanup
Fixed crashes