Fixed an issue

Now works for Matlab environment