fixing bug with javascript options for layouts