Fix bug in this snippet