added priority updating