fix dp bug