Same fix as pull requested by @suriya