fixed bug regarding closing of form when all inputs are empty