guards against overflow