final changes which fixes everything