fixed bug at line 271