added if check for null