Fixed error message and added similar check to getDuration as in search method.