FIX: fixed some bugs