Fixed javascript preview issue