buy.py bugs to be fixed