edited form function