I have tried it, but it does not work, I debugged the code and I found that update handler is called before oncommand.