Resolved potential null reference exception