Fixed last commit. Duplicate code