get rid of js undefined errors