bug fixes based on local testing
working! code review commetns