fixing the poision of legend