realized popup form logic