bug fixes with returning