Fadeout not working was caused by accidently using the == instead =. so I was just doing a comparison instead of an assignment silly me.