added error checking in invokeCmd()
using stringbuffer
Merged error dialog from benwaffle