updating http script to not use finally statement