fixed bugs coming from transition Q -> when.js