Added default sorting for relation
Added error log when there is something wrong with sorting