fix js function for checking fields