fixed an issue with array.find method