Adding error handling to Fs call

Signed-off-by: JG-liv <jgilbert@liv.ac.uk>