applied changes from jasond patch