MADE:
--> Created function to get last error