Minor bug fix
improved code readability