added case for success and failures