set legends properly