marking as sent before sending the receipt
added logging for server.py