fixes JS coerce to bug