Fixed all majior bug resulting in pc crash