corrected bug found by minhaz