fixing js pattern