added null checks for rendering item in razor project