change custom handler to directive