Bug fixing phase 2