error fixed by Charles up to comment