prevent form rendering in admin mode
cleaned up code