fix bug
working version