recoded callback logic, added resrved protocol commands