something is wrong, i am going to rewrite everything in the read function