will throw error if giving wrong filepath