Revert move application dir and further modify Input valid_ip function