Added error message if the params are not right