fix undefined filepath