checking for nulls at every stage
removed extra session parameter
Redirecting instantly if no session parameters are found