Solved (and tested) issue 39