bug fixing for version 1