4th attempt to fix minor code bug