fixed numerous issues