removed trailing slash
corrected return codes