final fix to bug from previous commits