add build safe guards