trying to add legend but does not work