fixed Q is not defined message on error