fixed end to soon bug