fixed function error