Fixed crashing bug due to incorrect parameters