updated buggy code to be able to compile it gain