Fixing setPriority in change of before after