Fix logic and path