Solved the reason why it was not working