Correct intendation and check for null state