bug fixing for the first part