add guard to prevent error