fixed js bug for rect outline