sort direction should be boolean as per parameter check