Optimazing iframe functions to work for all tabs