replace Q with when