Fixed the bug i was getting