Fixed the bug. It was an issue with 'do'