added check for illegal sales and fixed bug in ready