bug fixes... still not 100%