I think i got a clue why it was not working