metrics script bugfix