added gerResuls error check and some other minor changes