Removed extra assignment
Replaced separate statement for page capture