fixing minor code issues