Tweaked writing the status file
force $active_states into one argument