using debug instead of console now
debug bug-fixing
small bug fixed. needed .call instead of .apply