Fixes issue with footpath closing

Fixes #233. Issue was caused by not returning after a function call.