fixed location parameter check and added newline to end of file