fixed some bugs(?)