going to have to convert this to a javaagent