modifying api to fix a bug