bug fixing in phase2