work but with some errors