fixed null pointer when quantity is null