Instead of return, you should use callbacks as in asynchronous operations, return does not wait for the I/O operation to complete.
return
callbacks
asynchronous
I/O