Added sortBy parameter to select()