fix shadow size calculation
fix crash bug