null reference exception for regular statecourt