update fix for #3645 as sugested by domcleal