solved some bugs, more stable