3rd attempt to fix coding bug