changed click listeners from body to document