GY-521 in particular and MPU6050 in general make quite poor IMUs. Why do you use them? And what for in this particular case?
What do they do in this set up?
Yaw drift is my problem, so I tried a bunch of IMUs.
Ones built around BNO055 seem to be alright and they are not that much more expensive.
I ended up using Adafruit's.