fixes stop_keep bug