fixing broken code