fixed a bug with const structs as params