fixed matlab error