make the code snippet a bit safer