fixed a very big bug in my code