use js guard