Add support for memory widget

also add extra checking for existing commands