trim before checking if project new field is empty, and yes we need a lot of love in JS arena