fixed some issues, hope it final