Fixed sendFile method