fixed js func