added try catch to IPC