added JSONRPCException handling and fixed bug when wallet is already unlocked