fixed broked code