Fixed some critical bugs and memory leaks

For some reason environment again disposed of toolbar actions for two times