fixing validation, correctly restore path when returning