fixed bug in performance function