fixed my previous attempt. Now both status and permission change work.