Added proper exception handling in page for adding medicine