fixed possible bug on buying when non-int is supplied for quantity