Fixed variable substitution and added variables in url