updated to fix various issues