Add additional check for Q and when