made startup.m more robust