Fixes bug when response or body is undefined