merging patch from @mozai