fixed typo in active/inactive calculation