How to fix empty field errors