Updated code to more recent octoprint version