bug fixes in erb template