Bug fix(working version)