Moved buffer to static within function