Embedded form is not working correctly