fixed null reference issue