check for null pointer just in case