Added extra code to deal with failed connection to RMI object