replaced return with exit in bash script