added errormessage for frontend