Added error handle