Fix bug in the function to get code of account