Fixxed some bugs