fixed bug in quality check