Some improvements made

Better error handling. And now it takes the last profile name
introduced, by default