fixed qLen bug