redesigned without iframes, added base input check