changed to HAML and added error messages