Temporary hack to fix array out of bounds exception