Fix the logic here