fixed bug caused by replacing a hardcoded 'completed' change with a function, making it dynamic
in all cases