fixed potential undefined index on path variable