Handled null input
Added EndRequest handling