edited code snippet in post