fixed bug on View Item.  Cleaned up code