fixed js overwriting in new check func