fix error in directive js