bugs fix + little improvements