Bug is done
This works better now