fixed null value and arrays issue