Modified readme. Added error handling for function