add try catch to get error on reques head and log in terminal