updated with bug fix