Solve bugs and added new changes