fix bug in glass.py