fix the way kwargs are handled so that the layout is not lost