make sure return {ok, elem()} | {error, Reason}