fixed issues, untested