allowing dict to be passed instead of string