fix some bugs 18/12/2013