Modified memory check function in join