fixes somes bugs when refactorised
fixes controllers