added new function withMaybe