Suggested fix by @mgwalm close #277