Fixed some bugs and back activity problem