Before you do any reading you must test if data is available. Reading without testing is like watching a TV program before they start broadcasting it.
Your use of delay() in this case fortuitously gives the data time to arrive, however that is not the recommended method.
See: Gammon Forum : Electronics : Microprocessors : How to process incoming serial data without blocking