fixing the signal handling issues with Java