Fix JS error for undefined variable
Adjust layout