previous implementation didnt work, lets try this one