Try to cleanup javascript to prevent null value problems