adding formatData to enable more data type than only array