fixed authentication and added timeout

fixed to not allow execution without valid password and added timeout of 10s to avoid brute force attacks. Security for this script is not bullet proof but it got just a little better.