moved the state correction to pdf()