[*] Added error handling